home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / thor / thor24arexx.lha / JoinNewGroup.thor < prev    next >
Text File  |  1996-11-11  |  2KB  |  58 lines

  1. /* JoinNewGroup.thor by Neil Bothwick                   */
  2. /* $VER: JoinNewGroup.thor 1.0a (21.06.96)                */
  3. /* Presents the contents of a NewGroups message in a    */
  4. /* listview and creates join events for those selected  */
  5.  
  6. options results
  7.  
  8. /* needs THOR and bbsread.library functions */
  9.  
  10. thorport = address()
  11. if left(thorport,5) ~= 'THOR.' then do
  12.     say 'No THOR port found. This script must be run from Thor.'
  13.     exit 10
  14.     end
  15.  
  16. if ~show('p', 'BBSREAD') then do
  17.     address command
  18.     'run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead'
  19.     'WaitForPort BBSREAD'
  20.     end
  21.  
  22. address(thorport)
  23. drop MSG.
  24. CURRENTMSG stem MSG                                         /* Get info on current message */
  25. if rc ~= 0 then ExitMsg(THOR.LASTERROR)
  26. if upper(MSG.CONFNAME) ~= 'INFORMATION' then ExitMsg('This script only works from the Information conference')
  27.  
  28. address(bbsread)                                            /* Read list of new newsgroups */
  29. drop TEXT.
  30. READBRMESSAGE bbsname '"'MSG.BBSNAME'"' confname '"'MSG.CONFNAME'"' msgnr MSG.MSGNR textstem TEXT
  31.  
  32. address(thorport)
  33. drop PICKED.
  34. REQUESTLIST instem TEXT.TEXT outstem PICKED                 /* Show new groups in a listview */
  35.  
  36. if RC = 5 then ExitMsg('No newsgroup selected')
  37. if RC > 0 then ExitMsg(THOR.LASTERROR)
  38.  
  39. NewGroup = RESULT
  40.  
  41. address(bbsread)
  42. drop NEWEVENT.                                              /* Create join event */
  43. NEWEVENT.CONFERENCE = NewGroup
  44. WRITEBREVENT bbsname '"'MSG.BBSNAME'"' event 2 stem NEWEVENT
  45. if rc ~= 0 then ExitMsg(BBSREAD.LASTERROR)
  46.  
  47. address(thorport)
  48. REQUESTNOTIFY '"'NewGroup' joined"' '"OK"'
  49.  
  50. exit
  51.  
  52. ExitMsg:
  53.     address(thorport)
  54.     parse arg errmsg
  55.     REQUESTNOTIFY '"'errmsg'"' '" OK "'
  56.     exit
  57.  
  58.